package de.baumann.browser.api.net


import de.baumann.browser.api.net.base.BaseUrl
import de.baumann.browser.api.net.vo.NewsColumn
import de.baumann.browser.api.net.vo.NewsItem
import de.baumann.browser.api.net.vo.Result
import io.reactivex.Observable
import retrofit2.http.Field
import retrofit2.http.FormUrlEncoded
import retrofit2.http.POST

@BaseUrl(ApiKey.NEWS_URL)
interface NewsApiService {

    @POST("getTaxonomy")
    fun getColumn(): Observable<Result<List<NewsColumn>>>


    @FormUrlEncoded
    @POST("getArticle")
    fun getNews(@Field("page") page: Int,
                @Field("page_size") pageSize: Int,
                @Field("taxonomy_id") columnId: String): Observable<Result<List<NewsItem>>>

}
